package stancel.peter.smartsilencer;

import java.io.Serializable;

public class Event implements Serializable{

	private static final long serialVersionUID = 8439349263323323243L;

	private String name;
	private boolean vibration = true;
	private boolean silence = false;
	//Urcuje ci je udalost aktivna alebo nie.
	private boolean turnOn = true;
	private boolean airplaneMode = false;
	private boolean onetime = true;
	//Cas od kedy ma byt udalost aktivna.
	private int dateStart;
	//Cas do kedy ma byt udalost aktivna.
	private int dateEnd;
	/** Pole booleanov reprezentujuci dni v tyzdni.[Ned,Pon,Uto,Str,Stv,Pia,Sob] */
	private boolean[] days;
	private boolean nextDay;

	public Event(String name, boolean vibration, boolean silence, boolean airplaneMode, boolean onetime, int dateStart, int dateEnd, boolean[] days, boolean nextDay) {
		this.name = name;
		this.vibration = vibration;
		this.silence = silence;
		this.airplaneMode = airplaneMode;
		this.onetime = onetime;
		this.dateStart = dateStart;
		this.dateEnd = dateEnd;
		this.days = days;
		this.nextDay = nextDay;
	}

	public void setDays(boolean[] days) {
		this.days = days;
	}
	
	public void setNextDay(boolean nextDay) {
		this.nextDay = nextDay;
	}

	/**
	 * Vrati hodnotu, urcujucu ci je dateStart vacsi ako dateEnd.
	 * @return hodnota
	 */
	public boolean isNextDay() {
		return nextDay;
	}

	/**
	 * Vrati pole dni.
	 * @return pole dni
	 */
	public boolean[] getDays() {
		return days;
	}
	
	public void setName(String name) {
		this.name = name;
	}

	public void setOnetime(boolean onetime) {
		this.onetime = onetime;
	}
	
	/**
	 * Nastavuje vibrovaci rezim.
	 * @param vibration vibrovaci rezim
	 */
	public void setVibration(boolean vibration) {
		this.vibration = vibration;
	}

	/**
	 * Nastavuje tichy rezim.
	 * @param silence tichy rezim
	 */
	public void setSilence(boolean silence) {
		this.silence = silence;
	}

	/**
	 * Nastavuje letovy rezim.
	 * @param airplaneMode letovy rezim
	 */
	public void setAirplaneMode(boolean airplaneMode) {
		this.airplaneMode = airplaneMode;
	}

	/**
	 * Vrati meno udalosti.
	 * @return meno udalosti
	 */
	public String getName() {
		return name;
	}

	/**
	 * Vrati vybrovaci rezim.
	 * @return vybrovaci rezim
	 */
	public boolean isVibration() {
		return vibration;
	}

	/**
	 * Vrati tichy rezim.
	 * @return tichy rezim
	 */
	public boolean isSilence() {
		return silence;
	}

	/**
	 * Nastavi hodnotu, ktora urcuje, ci je udalost zapnuta alebo vypnuta.
	 * @param turnOn hodnota
	 */
	public void setTurnOn(boolean turnOn) {
		this.turnOn = turnOn;
	}

	/**
	 * Vrati hodnotu, ci je udalost zapnuta alebo vypnuta.
	 * @return turnOn hodnota
	 */
	public boolean isTurnOn() {
		return turnOn;
	}
	
	/**
	 * Vrati letovy rezim.
	 * @return letovy rezim
	 */
	public boolean isAirplaneMode() {
		return airplaneMode;
	}
	
	public boolean isOnetime() {
		return onetime;
	}
	
	public void setDateEnd(int dateEnd) {
		this.dateEnd = dateEnd;
	}
	
	public void setDateStart(int dateStart) {
		this.dateStart = dateStart;
	}

	/**
	 * Vrati datum aktivacie udalosti.
	 * @return datum aktivacie udalosti
	 */
	public int getDateStart() {
		return dateStart;
	}

	/**
	 * Vrati datum deaktivacie udalosti.
	 * @return datum deaktivacie udalosti
	 */
	public int getDateEnd() {
		return dateEnd;
	}
	
//	/**
//	 * Vrati cas aktivacie udalosti.
//	 * @return cas aktivacie udalosti
//	 */
//	public int getStartTime(){
//		return dateStart.get(Calendar.HOUR_OF_DAY) * 100 + dateStart.get(Calendar.MINUTE);
//	}
//	
//	/**
//	 * Vrati cas deaktivacie udalosti.
//	 * @return cas deaktivacie udalosti
//	 */
//	public int getEndTime(){
//		return dateEnd.get(Calendar.HOUR_OF_DAY) * 100 + dateEnd.get(Calendar.MINUTE);
//	}
}
